package com.learnJava.singleinstance;

public class B {
    // 私有化静态变量
    private static B b = null;
    private B() {

    }

    public static B getInstance() {
        if (b == null) {
            b = new B();
        }
        return b;
    }
}
